﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VIP课程.Collections
{
    public class MyList<T> : ICollection<T>
    {
        private T[] _items;

        private int capacity = 100;
        private int _index  = 0;

        public MyList()
        {
            _items = new T[capacity];
        }
        public int Count => _index;

        public bool IsReadOnly => throw new NotImplementedException();

        public void Add(T item)
        {
            _items[_index++] = item;
        }

        public void Clear()
        {
            Array.Clear(_items, 0, capacity);
            _index = 0;
        }

        public bool Contains(T item)
        {
            throw new NotImplementedException();
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            throw new NotImplementedException();
        }

        public IEnumerator<T> GetEnumerator()
        {
            throw new NotImplementedException();
        }

        public bool Remove(T item)
        {
            throw new NotImplementedException();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            throw new NotImplementedException();
        }
    }
}
